package com.zhuge_new.Adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhuge_new.R;
import com.zhuge_new.bean.RedDisolayBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2018-09-20.
 */

public class DataileAdapter extends BaseQuickAdapter<RedDisolayBean.ObjectBean.GetRedPersonListBean,BaseViewHolder> {


    private RedDisolayBean redDisolayBean;
    private Context context;
    public DataileAdapter(Context context, RedDisolayBean redDisolayBean) {
        super(R.layout.item_red_son, redDisolayBean.getObject().getGetRedPersonList());
        this.context=context;
        this.redDisolayBean=redDisolayBean;
    }


    @Override
    public int getItemCount() {
        return redDisolayBean.getObject().getGetRedPersonList().size()+getHeaderLayoutCount();
    }

    @Override
    protected void convert(BaseViewHolder helper, RedDisolayBean.ObjectBean.GetRedPersonListBean item) {
        helper.setText(R.id.son_name,item.getThreeNickName());
        helper.setText(R.id.son_time,item.getGetTime());
        helper.setText(R.id.son_money,item.getMoney());
        ImageView son_logo=helper.getView(R.id.son_logo);
        Log.e(item.getThreeHeadPhoto(),"打印url");
        Glide.with(context).load(item.getThreeHeadPhoto()).into(son_logo);
    }
}
